﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Works
{
    public partial class FormSummary : Form
    {
        private Label lblTotalPrice;
        private Button btnClose;

        // 构造函数中只调用 InitializeComponent，它由设计器自动生成
        public FormSummary()
        {
            InitializeComponent();
        }

        // 移除设计器生成的代码中的事件处理程序
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        // 添加一个新的方法来显示总价格
        public void ShowSummary(int? totalPrice)
        {
            this.textBox1.Text = $"总价格: {totalPrice}";
            this.ShowDialog();
        }

        private void FormSummary_Load(object sender, EventArgs e)
        {

        }

       
    }
}
